/*
PearReview - The peer review assistant.
Copyright (C) 2009  Dimitrij Pankratz, Anton Musichin
http://www.pearreview.com, info@pearreview.com

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

package com.pearreview.scribeplugin;

import javax.swing.Action;

import com.pearreview.ui.clock.ScribeClock;

/**
 * This interface allows a better communication between the single panels 
 * of the scribe mode and the ScribeView.
 * 
 * A scribe panel have not to implement this interface, but without it
 * the listed functions in this interface may not work. 
 */
public interface ScribePanel {
	
	/**
	 * Sets the scribe clock to the panel. Normally the clock is in the 
	 * heading of the panel.
	 * 
	 * The clock shows the duration of current meeting.
	 * 
	 * @param clock
	 */
	public void setClock(ScribeClock clock);
	
	public String getHint();
	/**
	 * Checks if form is valid
	 * @return <code>true</code> if form is valid, 
	 * otherwise <code>false</code>
	 */
	public boolean isValidForm();
	
	/**
	 * Each panel can return an error message to the view, if the form is
	 * not valid. This message will be displayed at a central position
	 * visible to the user, like the StepTabs.
	 * 
	 * There is only one message per form available, because of very less 
	 * restrictions given by the schema. In case of many available errors try
	 * to formulate your messages like: maybe error1 occurred or error2 or...
	 * 
	 * @see isValidForm()
	 * 
	 * @return Specific error for this panel.
	 */
	public String getErrorMessage();
	
	/**
	 * Sets the action for changing to the next view.
	 * 
	 * @param action
	 */
	public void setNextViewAction(Action action);
	
	/**
	 * Sets the action for changing to the previous view.
	 * 
	 * @param action
	 */
	public void setPreviousViewAction(Action action);
	
	/**
	 * Sets font size to panel
	 * @param fontSize size to set
	 */
	public void setFontSize(int fontSize);
	
	/**
	 * Returns panel size
	 * @return panel size or -1 if undefined
	 */
	public int getFontSize();
}
